<?php 

	//引入smarty类
	include './libs/Smarty.class.php';

	//实例化对象
	$s = new Smarty;

	//初始化参数
	$s->template_dir = './view';
	$s->compile_dir = './view_c';


	//分配变量
	$s->assign('title','今天星期三....');
	$s->assign('name','王颖楠帅哥');
	$s->assign('age',30);
	$s->assign('arr',['one','two','three']);
	class Stu
	{
		public $name ='水龙';
		public $age = 29;
	}
	$a = new Stu;

	$s->assign('obj',$a);

	//解析模板
	$s->display('2.html');




 ?>